/**
* <p>Deck of Cards</p>
* <p>Description:CS 235 Assignment #1</p>
* @author Luke Vang
* @email luke.vang@my.uwrf.edu
* @author
Name2
* @email
name2.here@my.uwrf.edu
* @author
Name3
* @email
name3.here@my.uwrf.edu
* @date
March 1st 2013
*/

package DeckOfCards;

import java.util.Random;

public class PlayingCards {

	private final Rank rank;
	private final Suit suit;

	public PlayingCards(Rank rank, Suit suit) {
		this.rank = rank;
		this.suit = suit;
	}// end of PlayingCards constructor

	public Rank getRank() {
		return rank;
	}// end of getRank

	public Suit getSuit() {
		return suit;
	}// end of getSuit

	/*
	 * Method shuffle will randomly shuffle each element in the array with no
	 * doubles This method stores the current index into a temp object, then it
	 * sets the current index to a random element in the array then sets a
	 * random position in the array to the stored index in temp
	 */
	public static PlayingCards[] shuffle(PlayingCards[] c) {
		int a = c.length;
		Random ranNum = new Random();
		for (int i = 0; i < a; i++) {
			int ranPosition = ranNum.nextInt(a);
			PlayingCards temp = c[i];
			c[i] = c[ranPosition];
			c[ranPosition] = temp;

		}
		return c;
	}

	public String toString() {
		return this.rank + " of " + this.suit;
	}// end of toString
}
